﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;

namespace RESTAURANT
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        /// 
        static bool IsConfigExist()
        {
            try
            {
                FileStream fs = new FileStream(Application.StartupPath + "\\khoisangviet.dat", FileMode.Open, FileAccess.Read);
                fs.Close();
                return true;
            }
            catch (System.IO.FileNotFoundException)
            {
                return false;
            }
        }
        [STAThread]
        static void Main()
        {
            MyServerConfig.InitServer("ServerConfig.xml");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (IsConfigExist()) //co file cau hinh
            {
                Application.Run(new frmSignInNoCard());
            }
            else //chua co file cau hinh
            {
                Application.Run(new frmServer());
                UsingSql.Refresh();
                Application.Run(new frmSignInNoCard());
            }
        }
    }
}
